package com.usefullc.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.usefullc.common.domain.BaseDomain;
import com.usefullc.common.enums.ValidActionEnum;
import com.usefullc.system.validator.UsefulPropertyVerify;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * Java Bean抽象实体 封装一些公用字段并且实现序列化
 */
@Data
public class BaseEntity extends BaseDomain {

    @UsefulPropertyVerify(required = true,action = ValidActionEnum.UPDATE)
    @ApiModelProperty(notes = "ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(notes = "数据创建时间")
    @TableField(value="gmtCreate",fill = FieldFill.INSERT)
    private Date gmtCreate;

    @ApiModelProperty(notes = "数据最后修改时间")
    @TableField(value="gmtModified",fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @ApiModelProperty(notes = "数据状态（0 不存在，1 存在）")
    @TableField(value = "delState")
    private Boolean delState = true;


}
